<?php
/**
 * Created by JetBrains PhpStorm.
 * User: thinhhung
 * Date: 5/24/12
 * Time: 3:07 PM
 * To change this template use File | Settings | File Templates.
 */
?>
<script type="text/javascript">
    $(document).ready(function(){
        $("#form").validate({
            messages: {
                "data[KhachHang][TENKH]": "Nhập tên khách hàng",
                "data[KhachHang][DIACHIKH]": "Nhập địa chỉ khách hàng"
            }
        });
    })
</script>

<?php
echo $this->Form->create('KhachHang', array('action' => 'add', 'id' => 'form'));
?>
<fieldset>
    <legend>Thêm khách hàng</legend>
    <dl>
        <dt><label>Đối tượng khách hàng</label></dt>
        <dd><?php echo $this->Form->input('DOITUONGKH_ID', array('type' => 'select', 'label' => false, 'options' => $doituongs)); ?></dd>
    </dl>
    <dl>
        <dt><label>Tên khách hàng</label></dt>
        <dd><?php echo $this->Form->input('TENKH', array('label' => false, 'class' => 'required')); ?></dd>
    </dl>
    <dl>
        <dt><label>Địa chỉ</label></dt>
        <dd><?php echo $this->Form->input('DIACHIKH', array('label' => false, 'rows'=> 3, 'cols' => 50, 'class' => 'txtarea required')); ?></dd>
    </dl>

</fieldset>
<div class="button">
<?php
    echo $this->Form->submit('Thêm', array('div' => false));
    echo $this->Html->link('Hủy', array('controller' => 'khach_hangs', 'action' => 'index'), array('class' => 'cancel'));?>

</div>
<?php
    echo $this->Form->end();
?>